package myschool.test3;

import myschool.dao.GradeDao;
import myschool.entity.Grade;
import myschool.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @author oldliu
 * @since 1.0
 */
public class TestGradAndStjud {
    public static void main(String[] args) {
        SqlSession s= MyBatisUtil.get();
        GradeDao mapper = s.getMapper(GradeDao.class);
        Grade grade = mapper.get(1L);
        MyBatisUtil.close(s);
        if(grade==null)
            return;
        System.out.println("年级信息:"+grade);
        System.out.println("此年级的学生信息如下：");
        grade.getStus().forEach(System.out::println);
    }
}
